package com.tangyuan.ai.entity.dto;


import com.tangyuan.ai.entity.enums.ModelTypeEnum;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
public class DialogueDTO {

    /**
     * 角色面具ID
     */
    private Long aiRoleMaskId;
    /**
     * 模型ID
     */
    @NotNull(message = "请选择您要使用的模型.")
    private Integer modelId;
    /**
     * 对话内容
     */
    @NotEmpty(message = "请输入您要咨询的内容")
    @Length(max = 3000,message = "您咨询的内容过长,请删减后重试.")
    private String content;

    public Integer getModelId() {
        return modelId == null || modelId == 0 ? ModelTypeEnum.ERNIE_4.id :modelId;
    }
    public Long getAiRoleMaskId() {
        return aiRoleMaskId == null || aiRoleMaskId < 0 ? 0 :aiRoleMaskId;
    }
}
